package hqu.cst.XAH.mapper;

import hqu.cst.XAH.pojo.Comment;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CommentMapper {

    @Insert("insert into comments (movie_id, content, rating) values (#{movie}, #{content}, #{rating})")
    void submitComment(Comment comment);

    //根据电影id查询评论
    @Select("select content  from comments where movie_id = #{id}")
    List<Comment> getCommentsByMovieId(Long id);
}
